<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link href="https://cdn.bootcdn.net/ajax/libs/mui/3.7.1/css/mui.css" rel="stylesheet">
  <style>
    .m-t10{
      margin-top: 10px;
    }
    .mui-btn{
      margin: 30px auto;
      display: block;
    }
  </style>
</head>
<body>
  <ul class="mui-table-view m-t10">
    <li class="mui-table-view-cell">1.请选择星座</li>
</ul>
  <ul class="mui-table-view mui-table-view-radio">
    <li class="mui-table-view-cell">
      <a class="mui-navigate-right">火系</a>
    </li>
    <li class="mui-table-view-cell mui-selected">
      <a class="mui-navigate-right">水系</a>
    </li>
    <li class="mui-table-view-cell">
      <a class="mui-navigate-right">土系</a>
    </li>
    <li class="mui-table-view-cell">
      <a class="mui-navigate-right">风系</a>
    </li>
  </ul>
  <ul class="mui-table-view m-t10">
    <li class="mui-table-view-cell">2.请选择喜欢的食物</li>
</ul>
  <ul class="mui-table-view mui-table-view-radio">
    <li class="mui-table-view-cell">
      <a class="mui-navigate-right">西瓜</a>
    </li>
    <li class="mui-table-view-cell mui-selected">
      <a class="mui-navigate-right">草莓</a>
    </li>
    <li class="mui-table-view-cell">
      <a class="mui-navigate-right">香蕉</a>
    </li>
  </ul>
  <button type="button" class="mui-btn mui-btn-primary" id="submit">确定</button>

  <script src="https://cdn.bootcdn.net/ajax/libs/mui/3.7.1/js/mui.min.js"></script>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
  <script class="">
    $('#submit').click(function(){
      // console.log()
      var list = $('.mui-selected');
      // console.log(list)
      var data = [];
      list.each(function(index,item){
        data.push(item.childNodes[1].innerHTML);
      });
      console.log(document.cookie)
      if(document.cookie.indexOf('myCookie')>0){
        var myCookie = Math.random().toString(36).slice(-6);
        documen.cookie="myCookie=crazyit;max-age="+(60*60*24*365); 
        
      }
      
      $.post('http://119.45.49.244:7001/myForm',{data: data},function(res){
        console.log(res)
      })
    })
    
  </script>
</body>
</html>